Version 1/060703 of Shipboard Directions by Mikael Segercrantz begin here. Chapter 1 - Declaring the directions Section 1a - Creating the directions The aft is a direction with opposite fore, Inform property "a_to" and Inform object "a_obj". The fore is a direction with opposite aft, Inform property "f_to" and Inform object "f_obj". The port is a direction with opposite starboard, Inform property "p_to" and Inform object "p_obj". The starboard is a direction with opposite port, Inform property "sb_to" and Inform object "sb_obj". Section 1b - Changing the room Include (- with a_to 0, sb_to 0, f_to 0, p_to 0, -) when defining a room. Section 1c - Change the directions Include (- with name 'a//' 'aft' 'aftward' 'ward', door_dir a_to, -) when defining the aft. Include (- with name 'f//' 'fore' 'foreward' 'ward', door_dir f_to, -) when defining the fore. Include (- with name 'p//' 'port' 'portward' 'ward', door_dir p_to, -) when defining the port. Include (- with name 'sb' 'starboard' 'starboardward' 'ward', door_dir sb_to, -) when defining the starboard. Shipboard Directions end here. ---- DOCUMENTATION ---- In this extension, we define four new directions; aft, fore, port and starboard. The new directions are created in a manner consistent with the default directions in the Inform 7 Standard Library. Example: *** Land Ohoy! - Creating a ship from which the player can disembark when next to land "Land Ohoy!" Include Version 1/060703 of Shipboard Directions by Mikael Segercrantz. A boolean is a kind of value. The booleans are true and false. Beside land is a boolean variable. Beside land is false. The Time of Day is 2:45 PM. At 2:50 PM: say "The lookout shouts 'Land Ohoy!' from somewhere up the main mast." At 2:55 PM: say "The ship gently lurches against the beach, the anchor being lowered into the water."; change beside land to true. At 3:00 PM: if the location is not the inviting beach begin; say "You are gently but definitely ushered off the ship, just as it sets sail back for England."; change beside land to false; move the player to the inviting beach; end if; change beside land to false. The Mid-deck is a room. "You're about half-way across the deck, measured from the fore to the aft. You could visit the fore deck or the aft deck[if beside land is true], or you could disembark to the port[end if]." The Fore Deck is a room. "Standing at the fore of the ship, you can see [if beside land is true]the inviting beach along with [end if]the river mouth." It is fore of the mid-deck. The Aft Deck is a room. "Standing at the aft of the ship, you can see [if beside land is true]along with the inviting beach the [end if]vast ocean behind you." It is aft of the mid-deck. Instead of going up: say "You wouldn't know how to climb the ropes to the masts, being a land-lubber as you are." The Inviting Beach is a room. "An inviting beach, with [if beside land is true]a ship nearby, just to the north[otherwise]people looking in awe at the new world[end if]." It is port of the mid-deck. Starboard of the inviting beach is nowhere. North of the inviting beach is the mid-deck. South of the mid-deck is nowhere. Instead of going port from the mid-deck when beside land is false, say "You wouldn't want to swim all the way back to shore, being the land-lubber you are." Instead of going north from the inviting beach when beside land is false, say "What, and swim back to the ship? No thank you." When play begins, change right hand status line to "[time of day]".